﻿using Microsoft.AspNetCore.Mvc;
using ProtobufNetShared;

namespace ProtobufNetClient.Controllers
{
    [ApiController]
    [Route("[controller]/[action]")]
    public class HelloController : ControllerBase
    {
        IGreeterService service;
        public HelloController(IGreeterService service) 
        {
            this.service = service;
        }

        [HttpGet(Name = "Echo")]
        public string Echo(string name)
        {
            return service.SayHelloAsync(new HelloRequest { Name = name }).Result.Message;
        }

    }
}
